package com.wsh.controller.generator;

import com.wsh.entity.generator.GenFileConfEntity;
import com.wsh.generator.GenFileConfService;
import com.wsh.utils.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
* @author 王思涵
* @date 2020-02-22
*/
@Api(tags = "表附件配置管理")
@RestController
@RequestMapping("/generCode/genFileConf")
public class GenFileConfController {

    @Autowired
    private GenFileConfService genFileConfService;

    @GetMapping("/getById")
    @PreAuthorize("@el.check('genFileConf:getById')")
    @ApiOperation(value = "查询表附件配置")
    public Object getById(@RequestParam String tableName, @RequestParam String colName) {

        return JsonResult.success(null);
    }

    @PostMapping("/save")
    @PreAuthorize("@el.check('genFileConf:save')")
    @ApiOperation("保存附件配置")
    public Object save(@RequestBody GenFileConfEntity genFileConfEntity) {
        return JsonResult.success(genFileConfService.saveOrUpdate(genFileConfEntity));
    }

}
